﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Console开放封闭原则
{
    // 调整1
    public class BankProcess01
    {
        public IDeposite deposite { get; set; }
        public IDrawMoney drawMoney { get; set; }
        public ITransfer transfer { get; set; }

        public void DepositeFunc()
        {
            deposite.DepositeInterface();
        }
        public void DrawMoneyFunc()
        {
            drawMoney.DrawMoney();
        }
        public void TransferFunc()
        {
            transfer.TransferInterface();
        }
    }
    public interface IDeposite
    {
        void DepositeInterface();
    }
    public interface IDrawMoney
    {
        void DrawMoney();
    }

    public interface ITransfer
    {
        void TransferInterface();
    }

    public class DepostieClass : IDeposite
    {
        public void DepositeInterface()
        {
            Console.WriteLine("存钱");
        }
    }

    public class DrawMoneyClass : IDrawMoney
    {
        public void DrawMoney()
        {
            Console.WriteLine("取钱");
        }
    }
    public class TransferClass : ITransfer
    {
        public void TransferInterface()
        {
            Console.WriteLine(  "转账");
        }
    }

}
